module WillPaginate
  module ViewHelpers
    
    #pragmatic-minds: redefinimos este metodo para cambiarle el texto que muestra y manejar I18n
    def page_entries_info(collection, options = {})
      #entry_name = options[:entry_name] ||
        (collection.empty?? 'entry' : collection.first.class.name.underscore.sub('_', ' '))

      if collection.total_pages < 2
        case collection.size
        when 0; t('lbl_paginate_no_record_found')
        when 1; t('lbl_paginate_show_one_record')
        else;   "#{t('lbl_paginate_show_all_records')}: <b>#{collection.size}</b>"
        end
      else
        %{#{t('lbl_paginate_show_partial_records')}: <b>%d&nbsp;-&nbsp;%d</b> #{t('lbl_paginate_of_label')} <b>%d</b> #{t('lbl_paginate_total_label')}} % [
          collection.offset + 1,
          collection.offset + collection.length,
          collection.total_entries
        ]
      end
    end
  end
end
